<div class="box">
    <div class="out">
        <div class="inner"><div class="content"></div></div>
    </div>
    <div class="out">
        <div class="inner"><div class="content"></div></div>
    </div>
    <div class="out out-col-last">
        <div class="inner"><div class="content"></div></div>
    </div>
</div>
<div class="box">
    <div class="out">
        <div class="inner"><div class="content"></div></div>
    </div>
    <div class="out">
        <div class="inner"><div class="content"></div></div>
    </div>
    <div class="out out-col-last">
        <div class="inner"><div class="content"></div></div>
    </div>
</div>
<div class="box">
    <div class="out out-row-last">
        <div class="inner"><div class="content"></div></div>
    </div>
    <div class="out out-row-last">
        <div class="inner"><div class="content"></div></div>
    </div>
    <div class="out out-row-last out-col-last">
        <div class="inner"><div class="content"></div></div>
    </div>
</div>

<style>
    body {
        background-color: gray;
    }
    .content {
        width: 100px;
        height: 100px;
    }
    .out {
        border-bottom: 1px solid grey;
        border-right: 1px solid grey;
        border-radius: 20px;
    }
    .inner {
        width: 100%;
        height: 100%;
        background-color: white;
        padding: 5px;
    }
    div {
        box-sizing: border-box;
    }
    .box {
        display: flex;
        flex-direction: row;
    }
    .out-row-last {
        border-bottom: none;
    }
    .out-col-last {
        border-right: none;
    }
</style>
